import { App } from 'vue';
import CusEditor from './editor/index.vue';
import CusTree from './tree/index.vue';
import CusList from './list/index.vue';
import CusForm from './form/index.vue';
import CusEmpty from './empty/index.vue';
import CusSkeleton from './skeleton/index.vue';
import CusQuery from './query/index.vue';
import CusCondition from './condition/index.vue';
import CusTable from './table/index.vue';
import CusSteps from './steps/index.vue';
import CusStepPane from './steps/item.vue';
import CusTag from './tag/index.vue';
import CusEditable from './editable/index.vue';
import CusEditableToolbar from './editable/toolbar.vue';
import CusEditableItem from './editable/item.vue';
import CusState from './state/index.vue';

export const components = {
  CusEditor,
  CusTree,
  CusList,
  CusTable,
  CusForm,
  CusEmpty,
  CusSkeleton,
  CusQuery,
  CusCondition,
  CusSteps,
  CusStepPane,
  CusTag,
  CusEditable,
  CusEditableToolbar,
  CusEditableItem,
  CusState
};

const install = (Vue: App) => {
  Object.keys(components).map(key => Vue.component(components[key].name, components[key]));
};

export default {
  version: '0.0.1',
  install,
  ...components
}

export interface CusTable {
  request: (params?: any) => void
}